﻿@using Admin.Common
<div class="col-xs-12">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h2><i class="fa fa-indent red"></i><strong>查询条件</strong></h2>
        </div>
        <div class="panel-body">
            <form action="" method="post" class="form-inline" id="form1" name="form1">
                <div class="form-group">
                    <label class="control-label" for="if-email">交通工具名称</label>
                    <input type="text" id="txt_name" name="txt_name" class="form-control" placeholder="交通工具名称">
                </div>
                <div class="form-group">
                    <label class="control-label" for="if-email">创建时间</label>
                    <input type="text" id="txt_begintime" name="txt_begintime" class="form-control Wdate" placeholder="开始时间" onfocus="WdatePicker({dateFmt: 'yyyy-M-d H:mm:ss' })">-
                    <input type="text" id="txt_endtime" name="txt_endtime" class="form-control Wdate" placeholder="结束时间" onfocus="WdatePicker({dateFmt: 'yyyy-M-d H:mm:ss' })">
                </div>
            </form>
        </div>
        <div class="panel-footer">
            <button type="button" id="btn_Search" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 搜索</button>
            <button type="reset" class="btn btn-sm btn-danger" onclick="javascript: document.form1.reset();"><i class="fa fa-ban"></i> 重置</button>
        </div>
    </div>
</div>
<script>
    $("#btn_Search").click(function () {
        var con = new condition();
        $.btnClick({
            url: "/Vehicle/Search",
            data: { name: con.name, begintime: con.begintime, endtime: con.endtime }
        })
    });

    function condition() {
        this.name = $("#txt_name").val();
        this.begintime = $("#txt_begintime").val();
        this.endtime = $("#txt_endtime").val();
        return this;
    }
    function to_page(pageIndex) {
        var con = new condition();
        $.btnClick({
            url: "/Vehicle/Search",
            data: { name: con.name, begintime: con.begintime, endtime: con.endtime, pageIndex: pageIndex }
        })
    }
</script>

